INC	= ../include
LIB	= ../lib
BIN	= ../bin

CROSS_COMPILE	?=
VERSION		?= _DEBUG

CC	= @$(CROSS_COMPILE)gcc
LD	= @$(CROSS_COMPILE)gcc
ECHO	= @echo
RM	= @rm -fr

CFLAG	= -O3 -Wall -I$(INC) -D$(VERSION) -c
LFLAG	= -O3 -L$(LIB) -lEzfb

TARGET	= $(BIN)/demo
OBJECT	= demo.o

$(TARGET):$(OBJECT)
	$(ECHO) "  LD $@"
	$(LD) $(LFLAG) $^ -o $@

%.o:%.c
	$(ECHO) "  CC $@"
	$(CC) $(CFLAG) $< -o $@

clean:
	$(ECHO) "  RM *.o"
	$(RM) *.o
	$(ECHO) "  RM $(TARGET)"
	$(RM) $(TARGET)
